<template>
	<view class="container">
		<view class="tui-box" :class="skinStyle">
			<tui-list-cell :last="true" :hover="false">
				<view class="tui-flex-box" v-if="addressFlag">
					<text class="tui-icon-img iconfont icondizhi"></text>
					<view class="tui-addr">
						<view class="tui-addr-userinfo">
							{{ pickupName }}
							<text class="tui-addr-tel pickupMobile">{{ pickupMobile }}</text>
						</view>
						<view class="tui-addr-text">{{ areaLevel1 }}{{ areaLevel2 }}{{ areaLevel3 }}{{ addressDet }}</view>
					</view>
					<view class="address-tag theme-gradient-bg" @tap="editAddress()" v-if="!hasOrder">更换地址</view>
				</view>
				<view class="tui-flex-box" v-else><view class="addAddress theme-gradient-bg" @tap="addAddress()">新增地址</view></view>
				<view class="tui-bg-img"></view>
			</tui-list-cell>
			<view class="tui-top tui-goods-info">
				<tui-list-cell :hover="false" :lineLeft="false"><view class="tui-goods-title">商品信息</view></tui-list-cell>
				<view v-for="(item, index) in goodsData" :key="index">
					<block v-if="item.show !== 2">
						<tui-list-cell :hover="false" padding="0">
							<view class="tui-goods-item">
								<image src="../../../static/img/freeShipping.png" class="tui-goods-img imgMark" v-if="item.isSample === 0 && item.isParcel === 1"></image>
								<image src="../../../static/img/gift.png" class="tui-goods-img imgMark" v-else-if="item.isSample !== 0"></image>
								<image :src="imgSrc + item.suitProductThumbnailImageUrl" v-if="item.isSuit" class="tui-goods-img"></image>
								<image :src="imgSrc + item.productThumbnailImageUrl" v-else class="tui-goods-img"></image>
								<view class="tui-goods-center" v-if="item.isSuit">
									<view class="tui-goods-name">
										<span v-if="preSaleFlag == 1" class="preSaleTag">预售</span>
										{{ item.suitName }}
									</view>
									<view class="tui-goods-attr"></view>
								</view>
								<view class="tui-goods-center" v-else>
									<view class="tui-goods-name">
										<span v-if="preSaleFlag == 1" class="preSaleTag">预售</span>
										{{ item.productName }}
									</view>
									<view class="tui-goods-attr" v-if="item.specificationName != null">{{ item.specificationName }}</view>
								</view>
								<view class="tui-price-right" v-if="item.isSample !== 0">
									<view>￥0</view>
									<view>x{{ item.orderCount || item.productsCount }}</view>
								</view>
								<view class="tui-price-right" v-else-if="item.isSuit">
									<view>￥{{ (item.suitRealAmount / item.suitCount) | moneyFormat(item.suitRealAmount / item.suitCount) || '0' }}</view>
									<view>x{{ item.suitCount }}</view>
								</view>
								<view class="tui-price-right" v-else>
									<view v-if="(item.productDiscountPrice || item.productDiscountPrice == 0) && item.productDiscountPrice !== item.productPrice">
										<span style="padding-right: 20rpx;">￥{{ item.productDiscountPrice }}</span>
										<span style="text-decoration:line-through">￥{{ item.productPrice }}</span>
									</view>
									<view v-else>￥{{ item.productPrice }}</view>
									<view>x{{ item.orderCount || item.productsCount }}</view>
								</view>
							</view>
						</tui-list-cell>
					</block>
				</view>
				<view v-if="preSaleFlag == 1">
					<tui-list-cell :hover="false" :lineLeft="false" padding="0">
						<view class="tui-remark-box tui-padding tui-flex" v-if="!hasOrder || (remarks !== '' && remarks != null)">
							<view>订单备注</view>
							<input type="text" :disabled="hasOrder" class="tui-remark" placeholder="选填: 请先和商家协商一致" placeholder-class="tui-phcolor" v-model="remarks" />
						</view>
					</tui-list-cell>

					<tui-list-cell :hover="false">
						<view class="tui-padding tui-flex" :class="{ redRow: preSaleOrderStatus != 2 }">
							<view>阶段1 定金 ￥{{ depositPrice }}</view>
							<view>预售商品定金不退哦</view>
						</view>
					</tui-list-cell>
					<tui-list-cell :hover="false">
						<view class="tui-padding tui-flex" :class="{ redRow: preSaleOrderStatus == 2 }">
							<view>阶段2 尾款 ￥{{ balance }}</view>
							<view>{{ balanceTime || '付定金0天后' }}</view>
						</view>
					</tui-list-cell>
					<tui-list-cell :hover="false">
						<view class="tui-padding tui-flex">
							<view>阶段3 发货时间</view>
							<view>{{ deliverTime }}</view>
						</view>
					</tui-list-cell>
					<tui-list-cell :hover="false" v-if="preSaleOrderStatus == 2 || preSaleType === 1">
						<view class="tui-padding tui-flex">
							<view>运费</view>
							<view>
								<span class="tui-size-26" style="color: #E96D71;">{{ expressFee }}</span>
							</view>
						</view>
					</tui-list-cell>
				</view>
				<view v-else>
					<tui-list-cell :hover="false">
						<view class="tui-padding tui-flex">
							<view>商品价格</view>
							<view>￥{{ totalPrice | moneyFormat(totalPrice) }}</view>
						</view>
					</tui-list-cell>
					<tui-list-cell :hover="false">
						<view class="tui-padding tui-flex">
							<view>商品数量</view>
							<view>{{ totalCount }}</view>
						</view>
					</tui-list-cell>
					<tui-list-cell :hover="false" v-if="preSaleFlag != 1&&orderType!=2&&couponDictFlag=='0'">
						<picker @change="couponChange" :value="couponIndex" :range="couponArray" :disabled="couponNum === 0 || hasOrder" style="width: 100%;font-size: 26rpx;">
							<view class="refundInfo">
								<view class="setupTitle">优惠券:</view>
								<view class="setupCon">
									<text class="" v-if="couponLabel">{{ couponLabel }}</text>
									<text class="" v-else>当前有{{ couponNum }}张可用优惠券</text>
									<text class="iconfont iconxiangyou"></text>
								</view>
							</view>
						</picker>
					</tui-list-cell>
					<tui-list-cell :hover="false" v-if="postageDictFlag=='0'&&usePostage && productAmount - couponAmount < carriageLimit&&preSaleFlag != 1&&orderType!=2">
						<picker @change="postageChange" :value="postageIndex" :range="postageArray" :disabled="postageNum === 0 || hasOrder" style="width: 100%;font-size: 26rpx;">
							<view class="refundInfo">
								<view class="setupTitle">包邮券:</view>
								<view class="setupCon">
									<text class="" v-if="postageLabel">{{ postageLabel }}</text>
									<text class="" v-else>当前有{{ postageNum }}张可用包邮券</text>
									<text class="iconfont iconxiangyou"></text>
								</view>
							</view>
						</picker>
					</tui-list-cell>
					<tui-list-cell :hover="false" :lineLeft="false" padding="0" v-if="!hasOrder || (remarks !== '' && remarks != null)">
						<view class="tui-remark-box tui-padding tui-flex">
							<view>订单备注</view>
							<input type="text" :disabled="hasOrder" class="tui-remark" placeholder="选填: 请先和商家协商一致" placeholder-class="tui-phcolor" v-model="remarks" />
						</view>
					</tui-list-cell>
					<tui-list-cell :hover="false" v-if="couponSale">
						<view class="tui-padding tui-flex">
							<view>优惠券优惠</view>
							<view>
								<span class="tui-size-26" style="color: #E96D71;">-￥{{ couponAmount | moneyFormat(couponAmount) }}</span>
							</view>
						</view>
					</tui-list-cell>
					<tui-list-cell :hover="false" v-if="activeSale">
						<view class="tui-padding tui-flex">
							<view>活动优惠</view>
							<view>
								<span class="tui-size-26" style="color: #E96D71;">-￥{{ discountAmount | moneyFormat(discountAmount) }}</span>
							</view>
						</view>
					</tui-list-cell>
					<tui-list-cell :hover="false">
						<view class="tui-padding tui-flex">
							<view>商品合计</view>
							<view>
								<span class="tui-size-26 tui-price-large" style="color: #E96D71;" v-if="hasOrder">￥{{ productAmount | moneyFormat(productAmount) }}</span>
								<span class="tui-size-26 tui-price-large" style="color: #E96D71;" v-else>
									￥{{ (productAmount - couponAmount) | moneyFormat(productAmount - couponAmount) }}
								</span>
							</view>
						</view>
					</tui-list-cell>
					<!-- <tui-list-cell :hover="false" :last="true">
						<view class="tui-padding tui-flex tui-total-flex">
							<view class="tui-flex-end tui-color-red">
								<view class="tui-black">合计：</view>
								<view class="tui-size-26">￥</view>
								<view class="tui-price-large">{{ orderAmount }}</view>
							</view>
						</view>
					</tui-list-cell> -->
					<tui-list-cell :hover="false">
						<view class="tui-padding tui-flex">
							<view>运费</view>
							<view>
								<span class="tui-size-26" style="color: #E96D71;">{{ expressFee }}</span>
							</view>
						</view>
					</tui-list-cell>
				</view>
			</view>
		</view>
		<view class="tui-safe-area"></view>
		<view class="tui-tabbar submit-order-tabbar">
			<view class="tui-flex-end tui-color-red tui-pr-20" :class="skinStyle">
				<view class="tui-black">实付金额:</view>
				<view class="tui-size-26">￥</view>
				<view class="tui-price-large" v-if="hasOrder || preSaleFlag == 1">{{ orderAmount | moneyFormat(orderAmount) }}</view>
				<view class="tui-price-large" v-else>{{ (productAmount - couponAmount + expressFeePrice) | moneyFormat(orderAmount - couponAmount + expressFeePrice) }}</view>
				<!-- <view class="tui-size-26">.00</view> -->
			</view>
			<view class="category-btn" style="padding-bottom:15rpx ;">
				<tui-button :disabled="payBotton" width="200rpx" height="70rpx" type="primary" shape="circle" @click="getOpenId">确认支付</tui-button>
				<!-- <view class="theme-gradient-bg" @tap="getOpenId">更换地址</view> -->
			</view>
		</view>

		<loading :show="isLoading1 || isLoading2 || isLoading3"></loading>
		<tui-modal></tui-modal>
	</view>
</template>

<script>
import tuiButton from '@/components/button/button';
// import uniPopup from '@/components/uni-popup/uni-popup.vue';
import tuiListCell from '@/components/list-cell/list-cell';
// import tuiBottomPopup from '@/components/bottom-popup/bottom-popup';
import mixin from '@/utils/mixin.js';
import MescrollMixin from '@/components/mescroll-uni/mescroll-mixins.js';
export default {
	mixins: [mixin, MescrollMixin],
	components: {
		tuiButton,
		tuiListCell
		// uniPopup
	},
	data() {
		return {
			imgSrc: this.$store.state.imgUrl,
			isLoading1: false,
			isLoading2: false,
			isLoading3: false,
			goodsData: [],
			carGoodsList: [],
			expressFee: '',
			totalCount: 0,
			totalPrice: 0,
			pickupName: '',
			pickupMobile: '',
			addressDet: '',
			customerAddressId: null,
			depositPrice: '',
			balance: '2.',
			balanceTime: '',
			deliverTime: '',
			orderAmount: 0,
			openId: '',
			addressFlag: false,
			areaLevel1: '',
			areaLevel2: '',
			areaLevel3: '',
			hasOrder: false,
			orderId: '',
			preSaleFlag: 0,
			preSaleAfterPaymentDateType: 0,
			depositRate: '',
			preSaleAfterPaymentEndDay: '',
			preSaleAfterPaymentEndHour: '',
			preSaleAfterPaymentFixedEndTime: '',
			preSaleAfterPaymentFixedStartTime: '',
			preSaleAfterPaymentStartDay: '',
			preSaleDateFixedStartTime: '',
			preSaleDateFixedEndTime: '',
			preSaleDateType: '',
			preSaleDeliveryTime: '',
			preSaleDeliveryTimeDay: '',
			preSaleDeliveryTimeHour: '',
			preSaleDeliveryTimeType: '',
			preSaleStatus: '',
			preSaleType: '',
			roundNumberFlag: '',
			preSaleOrderStatus: 0,
			shopcartFlag: '',
			remarks: '',
			activeSale: false,
			couponSale: false,
			discountAmount: null,
			couponAmount: null,
			couponArray: [],
			couponInfo: [
				{
					couponName: '不适用优惠券'
				}
			],
			couponIndex: '',
			couponLabel: '',
			useCoupon: true,
			couponNum: 0,
			productAmount: 0,
			orderType: null,
			ccId: null,
			payBotton: false,
			carriageLimit: '',
			carriagePrice: '',
			fd: false,
			expressFeePrice: 0,
			bargainId: null,
			usePostage: true,
			postageIndex: '',
			postageArray: [],
			postageNum: 0,
			postageLabel: '',
			postageInfo: [],
			cpId: null,
			couponDictFlag:0,
			postageDictFlag:0,
			areaLevel1code:'',
			areaLevel2code:'',
			areaLevel3code:'',
		};
	},
	onLoad(options) {
		// #ifdef H5
		this.$wechat.noShare();
		// #endif
		if (options.shopcartFlag) {
			this.shopcartFlag = options.shopcartFlag;
		}
		this.couponDictFlag = this.$store.state.dictDataAll.couponSwitch[0].dictValue;
		this.postageDictFlag = this.$store.state.dictDataAll.couponPacleSwitch[0].dictValue;
	},
	onUnload() {
		uni.removeStorageSync('carGoodsList');
		uni.removeStorageSync('productInfo');
	},
	onShow() {
		this.getOrderGoodsData();
		if (!this.carriagePrice){
			this.carriageSettingFun();
		}
		if (uni.getStorageSync('addressId')) {
			this.customerAddressId = uni.getStorageSync('addressId');
			uni.removeStorageSync('addressId');
		}
		const orderId = uni.getStorageSync('carGoodsList')[0].orderId;
		if (orderId && !this.customerAddressId) {
			this.getOrderAddress(orderId);
		} else {
			this.getUserAddress();	
		}
	},
	filters: {
		moneyFormat(num) {
			var result = parseFloat(num);
			result = Math.round(num * 100) / 100;
			var s_x = result.toString();
			var pos_decimal = s_x.indexOf('.');
			if (pos_decimal < 0) {
				pos_decimal = s_x.length;
				s_x += '.';
			}
			while (s_x.length <= pos_decimal + 2) {
				s_x += '0';
			}
			return s_x;
		}
	},
	methods: {
		moneyFormat(num) {
			var result = parseFloat(num);
			result = Math.round(num * 100) / 100;
			return result;
		},
		// #ifdef H5
		callPay(orderId, response) {
			if (typeof WeixinJSBridge === 'undefined') {
				if (document.addEventListener) {
					document.addEventListener('WeixinJSBridgeReady', this.onBridgeReady(orderId, response), false);
				} else if (document.attachEvent) {
					document.attachEvent('WeixinJSBridgeReady', this.onBridgeReady(orderId, response));
					document.attachEvent('onWeixinJSBridgeReady', this.onBridgeReady(orderId, response));
				}
			} else {
				this.payBotton = true;
				this.onBridgeReady(orderId, response);
			}
		},
		onBridgeReady(orderId, response) {
			let that = this;
			if (!response.package) {
				return;
			}
			WeixinJSBridge.invoke(
				'getBrandWCPayRequest',
				{
					appId: response.appId, //公众号名称，由商户传入
					timeStamp: response.timeStamp, //时间戳，自1970年以来的秒数
					nonceStr: response.nonceStr, //随机串
					package: response.package,
					signType: 'MD5', //微信签名方式：
					paySign: response.paySign //微信签名
				},
				function(res) {
					if (res.err_msg === 'get_brand_wcpay_request:ok') {
						// 使用以上方式判断前端返回,微信团队郑重提示：
						//res.err_msg将在用户支付成功后返回ok，但并不保证它绝对可靠。
						uni.showLoading({
							title: '支付成功'
						});
						that.payBotton = false;
						that.$eventHub.$emit('orderRefresh');
						setTimeout(() => {
							if (that.orderType == 2 && that.bargainId == null) {
								uni.redirectTo({
									url: '../../../packageB/pages/groupon/myGroupon?bargainId=' + response.bargainId
								});
							} else {
								uni.redirectTo({
									url: '../myOrder/myOrder'
								});
							}
						}, 2000);
					} else {
						that.payBotton = false;
						uni.redirectTo({
							url: '../orderDetail/orderDetail?&id=' + orderId
						});
					}
					WeixinJSBridge.log(response.err_msg);
				}
			);
		},
		// #endif
		carriageSettingFun() {
			this.isLoading3 = true;
			this.$http.carriageSetting().then(res => {
				this.isLoading3 = false;
				if (res.status === 0) {
					this.carriagePrice = res.data.carriagePrice;
					this.carriageLimit = res.data.carriageLimit;
				}
			});
		},
		couponChange(e) {

			var lastCoupon = JSON.parse(JSON.stringify(this.couponAmount));
			this.couponIndex = e.target.value;
			this.couponLabel = this.couponArray[this.couponIndex];
			this.couponAmount = this.couponInfo[this.couponIndex].couponPrice;
			this.ccId = this.couponInfo[this.couponIndex].ccId;
			if (this.ccId) {
				this.couponSale = true;
			} else {
				this.couponSale = false;
			}
			let price =this.moneyFormat(this.orderAmount - this.couponAmount);
			if (this.cpId && this.postageInfo[this.postageIndex].couponLimit > this.productAmount - this.couponAmount) {
				this.postageArray = [];
				this.cpId = null;
				this.postageIndex = this.postageArray.length;
				this.postageLabel = null;
				this.expressFee = '￥' + this.carriagePrice;
				this.expressFeePrice = JSON.parse(JSON.stringify(this.carriagePrice));
			}
			if (this.cpId && price >= this.carriageLimit) {
				this.cpId = null;
				this.postageLabel = null;
			}
			if (!this.fd && !this.cpId) {
				if (price < this.carriageLimit) {
					this.expressFee = '￥' + this.carriagePrice;
					this.expressFeePrice = JSON.parse(JSON.stringify(this.carriagePrice));
				} else {
					this.expressFee = '免运费';
					this.expressFeePrice = 0;
				}
			}
			let num = 0;
			this.postageArray = [];
			this.postageInfo.forEach((item, index) => {
				if (item.couponLimit == '不使用' || this.productAmount - this.couponAmount >= item.couponLimit) {
					this.postageArray.push(item.couponPacleName);
					num += 1;
				}
			});
			this.postageNum = num - 1;
			

			if (this.productAmount - this.couponAmount > this.carriageLimit && !this.fd) {
				this.cpId = null;
				this.postageIndex = this.postageArray.length;
				this.postageNum = num - 1;
				this.postageLabel = null;
			}
		},

		postageChange(e) {
			debugger
			this.postageIndex = e.target.value;
			this.postageLabel = this.postageArray[this.postageIndex];
			this.postageInfo.forEach((item,index)=>{
				if(item.couponPacleName==this.postageLabel){
					this.cpId = item.ccId;
				}
			})
			if (this.cpId) {
				this.expressFee = '免运费';
				this.expressFeePrice = 0;
			} else {
				const price = this.orderAmount - this.couponAmount;
				this.expressFee = '￥' + this.carriagePrice;
				this.expressFeePrice = JSON.parse(JSON.stringify(this.carriagePrice));
			}
		},

		getOrderAddress(id) {
			this.isLoading1 = true;
			const params = {
				orderId: id
			};
			this.$http.getOrderDetail(params).then(res => {
				if (res.status == 0) {
					this.addressFlag = true;
					this.pickupName = res.data.buyerInfo.receiveName;
					this.pickupMobile = res.data.buyerInfo.receiveTel;
					this.areaLevel1 = res.data.buyerInfo.areaLevel1;
					this.areaLevel2 = res.data.buyerInfo.areaLevel2;
					this.areaLevel3 = res.data.buyerInfo.areaLevel3;
					this.addressDet = res.data.buyerInfo.receiveAddress;
				}
				this.isLoading1 = false;
			});
		},
		getOrderGoodsData() {
			this.isLoading2 = true;
			this.payBotton = false;
			this.carGoodsList = uni.getStorageSync('carGoodsList');
			if (this.carGoodsList[0].orderType) {
				this.orderType = this.carGoodsList[0].orderType;
			}
			if (this.carGoodsList[0].bargainId) {
				this.bargainId = this.carGoodsList[0].bargainId;
			}
			if (this.carGoodsList[0].myOrder) {
				this.hasOrder = true;
				this.orderId = this.carGoodsList[0].orderId;
				this.remarks = this.carGoodsList[0].buyComment;

				this.preSaleOrderStatus = this.carGoodsList[0].preSaleOrderStatus;
			}
			if (this.carGoodsList[0].hasActive) {
				const item = uni.getStorageSync('productList');
				this.goodsData = item.productInfo;
				this.discountAmount = item.discountAmount;
				this.couponAmount = item.couponAmount;
				if (item.couponName) {
					this.couponLabel = item.couponName;
				} else {
					this.couponLabel = '无优惠券';
				}
				if (item.couponPacleName) {
					this.postageLabel = item.couponPacleName;
				} else {
					this.usePostage = false;
				}

				this.orderAmount = item.amount;
				this.totalCount = item.totalCount;
				this.totalPrice = item.totalPrice;
				if (this.discountAmount) {
					this.activeSale = true;
				}
				if (this.couponAmount) {
					this.couponSale = true;
				}
				if (item.expressFee > 0) {
					this.expressFee = '￥' + item.expressFee;
					this.productAmount = item.amount - item.expressFee;
				} else {
					this.expressFee = '免邮费';
					this.productAmount = item.amount;
				}
				this.isLoading2 = false;
			} else if (this.preSaleOrderStatus && this.carGoodsList[0].myOrder) {
				const item = uni.getStorageSync('productList');
				this.preSaleFlag = 1;
				//商品信息
				this.goodsData = item.productInfo;
				//尾款部分
				if (item.preSaleType != 1) {
					this.balance = this.moneyFormat(this.carGoodsList[0].finalPay - item.expressFee.toFixed(2));
				} else {
					this.balance = this.carGoodsList[0].finalPay;
				}
				this.balanceTime = this.carGoodsList[0].afterPaymentTime;
				// 定金部分
				if (item.preSaleType == 1) {
					this.depositPrice = this.moneyFormat(this.carGoodsList[0].deposit - item.expressFee.toFixed(2));
				} else {
					this.depositPrice = this.carGoodsList[0].deposit;
				}

				// 发货部分
				this.deliverTime = this.carGoodsList[0].preSaleDeliveryTimeText;
				// 其他部分
				this.preSaleType = item.preSaleType;
				if (this.preSaleOrderStatus === 1) {
					this.orderAmount = JSON.parse(JSON.stringify(this.carGoodsList[0].deposit));
				} else {
					this.orderAmount = JSON.parse(JSON.stringify(this.carGoodsList[0].finalPay));
				}
				if (item.expressFee > 0) {
					this.expressFee = '￥' + item.expressFee;
					this.expressFeePrice = item.expressFee;
				} else {
					this.expressFee = '免邮费';
					this.productAmount = item.expressFee;
				}
				this.isLoading2 = false;
			} else {
				let params = {
					productInfo: this.carGoodsList
				};
				this.$http.shopcart_orderData(params).then(res => {
					if (res.status == 0) {
						const goodsData = res.data.records[0];
						this.goodsData = res.data.records;
						let num = 0;
						let parcel = 0;
						this.goodsData.forEach((item, index) => {
							if (item.isSample === 0) {
								num++;
							}
							if (item.isSample === 0 && item.isParcel === 1) {
								parcel++;
							}
						});
						if (parcel >= 1) {
							this.fd = true;
							this.usePostage = false;
						}
						this.couponArray = [];

						if (res.data.couponInfo) {
							this.couponNum = res.data.couponInfo.length;
							this.couponInfo = res.data.couponInfo;
							this.couponInfo.push({
								couponName: '不使用优惠券',
								couponPrice: 0,
								ccId: null
							});
							res.data.couponInfo.forEach((item, index) => {
								this.couponArray.push(item.couponName);
							});
						} else {
							this.couponNum = 0;
						}
						this.postageArray = [];
						if (res.data.couponPacleInfo) {
							this.postageNum = res.data.couponPacleInfo.length;
							this.postageInfo = res.data.couponPacleInfo;
							this.postageInfo.push({
								couponPacleName: '不使用包邮券',
								couponLimit: '不使用',
								couponPacleId: null
							});
							res.data.couponPacleInfo.forEach((item, index) => {
								this.postageArray.push(item.couponPacleName);
							});
						} else {
							this.postageNum = 0;
						}

						this.discountAmount = res.data.discountAmount;
						if (this.discountAmount) {
							this.activeSale = true;
						}
						this.depositRate = goodsData.depositRate;
						this.depositPrice = res.data.deposit;
						this.preSaleFlag = goodsData.preSaleFlag;
						this.preSaleAfterPaymentDateType = goodsData.preSaleAfterPaymentDateType;
						this.preSaleAfterPaymentEndDay = goodsData.preSaleAfterPaymentEndDay;
						this.preSaleAfterPaymentEndHour = goodsData.preSaleAfterPaymentEndHour;
						this.preSaleAfterPaymentFixedEndTime = goodsData.preSaleAfterPaymentFixedEndTime;
						this.preSaleAfterPaymentFixedStartTime = goodsData.preSaleAfterPaymentFixedStartTime;
						this.preSaleAfterPaymentStartDay = goodsData.preSaleAfterPaymentStartDay;
						this.preSaleDateFixedEndTime = goodsData.preSaleDateFixedEndTime;
						this.preSaleDateFixedStartTime = goodsData.preSaleDateFixedStartTime;
						this.preSaleDateType = goodsData.preSaleDateType;
						this.preSaleDeliveryTime = goodsData.preSaleDeliveryTime;
						this.preSaleDeliveryTimeDay = goodsData.preSaleDeliveryTimeDay;
						this.preSaleDeliveryTimeHour = goodsData.preSaleDeliveryTimeHour;
						this.preSaleDeliveryTimeType = goodsData.preSaleDeliveryTimeType;
						this.preSaleStatus = goodsData.preSaleStatus;
						this.preSaleType = goodsData.preSaleType;
						this.roundNumberFlag = goodsData.roundNumberFlag;

						this.balance = res.data.finalPay;
						if (this.preSaleAfterPaymentDateType == 1 && this.preSaleOrderStatus != 2) {
							if (this.preSaleAfterPaymentStartDay && this.preSaleAfterPaymentStartDay > 0) {
								this.balanceTime = `付定金${this.preSaleAfterPaymentStartDay}天后`;
							} else {
								this.balanceTime = '付定金后';
							}
						} else if (this.preSaleAfterPaymentDateType == 1 && this.preSaleOrderStatus == 2) {
							this.balanceTime = '请在' + this.changeTime(this.carGoodsList[0].preSaleAfterPaymentEndTime) + '之前支付尾款';
						}

						if (this.preSaleAfterPaymentDateType == 2 && this.preSaleOrderStatus != 2) {
							this.balanceTime = this.changeTime(this.preSaleAfterPaymentFixedStartTime) + '后开始';
						} else if (this.preSaleAfterPaymentDateType == 2 && this.preSaleOrderStatus == 2) {
							this.balanceTime = '请在' + this.changeTime(this.carGoodsList[0].preSaleAfterPaymentEndTime) + '之前支付尾款';
						}

						if (this.preSaleDeliveryTimeType == 1) {
							let day = '';
							if (this.preSaleDeliveryTimeDay) {
								day = this.preSaleDeliveryTimeDay + '天';
							}
							let time = '';
							if (this.preSaleDeliveryTimeHour) {
								time = this.preSaleDeliveryTimeHour + '小时';
							}
							if (day == '' && time == '') {
								this.deliverTime = '付全款后';
							} else {
								this.deliverTime = '付全款后' + day + time + '后';
							}
						} else if (this.preSaleDeliveryTimeType == 2) {
							this.deliverTime = this.changeTime(this.preSaleDeliveryTime, 1) + '后开始';
						}

						this.orderAmount = res.data.amount;
						if (res.data.logisticsCost > 0) {
							this.expressFee = '￥' + res.data.logisticsCost;
							this.expressFeePrice = res.data.logisticsCost;
							this.productAmount = res.data.amount - res.data.logisticsCost;
						} else {
							this.expressFee = '免邮费';
							this.productAmount = res.data.amount;
						}
						this.totalCount = 0;
						this.totalPrice = 0;
						for (let i = 0; i < this.carGoodsList.length; i += 1) {
							for (let j = 0; j < this.goodsData.length; j += 1) {
								if (this.goodsData[j].specificationId == this.carGoodsList[i].specificationId && this.goodsData[j].isSample === 0&&this.goodsData[j].specificationId) {
									this.totalCount += this.carGoodsList[i].productsCount;
									this.totalPrice += this.carGoodsList[i].productsCount * this.goodsData[j].productDiscountPrice;
									this.goodsData[j].orderCount = this.carGoodsList[i].productsCount;
									this.goodsData[j].id = this.carGoodsList[i].id;
								} else if (this.goodsData[j].suitId == this.carGoodsList[i].suitId && this.goodsData[j].isSample === 0 && this.goodsData[j].suitId != null) {
									this.totalCount += this.carGoodsList[i].productsCount;
									this.totalPrice += this.carGoodsList[i].productsCount * this.goodsData[j].productDiscountPrice;
									this.goodsData[j].orderCount = this.carGoodsList[i].productsCount;
									this.goodsData[j].id = this.carGoodsList[i].id;
								}
							}
						}
					}
					this.isLoading2 = false;
				});
			}
		},

		changeTime(time, id) {
			const date = time.split(' ');
			const month = date[0].split('-')[1];
			const day = date[0].split('-')[2];
			const hour = date[1].split(':')[0];
			const min = date[1].split(':')[1];
			if (id === 1) {
				return month + '月' + day + '日 ';
			} else {
				return month + '月' + day + '日 ' + hour + ':' + min;
			}
		},

		getOpenId() {
			if (!this.addressFlag) {
				uni.showToast({
					title: '请填写收货地址!',
					icon: 'none'
				});
				return;
			}
			if (this.orderAmount <= 0) {
				uni.showToast({
					title: '付款金额发生错误，请联系客服!',
					icon: 'none'
				});
				return;
			}
			var that = this;
			that.payBotton = true;
			//#ifdef MP-WEIXIN
			wx.login({
				success(res) {
					if (res.code) {
						that.openId = res.code;
						console.log(that.openId);

						that.btnPay();
					} else {
						console.log('登录失败！' + res.errMsg);
					}
				}
			});
			//#endif
			// #ifndef MP-WEIXIN
			that.btnPay();
			//#endif
		},
		subOrderId(id) {
			if (id.substr(id.length - 1, 1) == 'D') {
				return id.substr(0, id.length - 1);
			} else {
				return id;
			}
		},
		btnPay() {
			const device = uni.getSystemInfoSync().platform;
			let num = 0;
			if (device == 'ios') {
				num = 2;
			} else if (device == 'android') {
				num = 1;
			}
			//#ifdef MP-WEIXIN
			num = 0;
			//#endif
			//#ifdef H5
			num = 3;
			//#endif
			console.log(num);

			if (this.hasOrder) {
				const params = {};
				params.realAmount = this.orderAmount;
				params.device = num;
				// #ifdef MP-WEIXIN
				params.code = this.openId;
				//#endif
				//#ifdef H5
				params.code = uni.getStorageSync('h5Openid');
				//#endif
				params.orderId = this.subOrderId(this.orderId);
				if (this.carGoodsList[0].orderType == 2) {
					params.orderType = 2;
				} else {
					if (this.preSaleFlag == 1) {
						params.orderType = 3;
					} else if (this.preSaleFlag == 0) {
						params.orderType = 1;
					}
				}
				var that = this;
				this.$http.payOrder(params).then(res => {
					if (res.status == 0) {
						console.log(res.data);
						const orderId = this.subOrderId(res.data.orderId);
						//#ifdef H5
						this.callPay(orderId, res.data);
						// #endif
						//#ifdef MP-WEIXIN || APP-PLUS
						uni.requestPayment({
							provider: 'wxpay',
							//#ifndef MP-WEIXIN
							orderInfo: {
								package: res.data.package,
								appid: res.data.appId,
								sign: res.data.paySign,
								prepayid: res.data.prepayId,
								noncestr: res.data.nonceStr,
								timestamp: res.data.timeStamp,
								partnerid: res.data.partnerid
							},
							//#endif

							// #ifdef MP-WEIXIN
							appId: res.data.appId,
							timeStamp: res.data.timeStamp,
							nonceStr: res.data.nonceStr,
							package: res.data.package,
							signType: res.data.signType,
							paySign: res.data.paySign,
							//#endif

							success: function(res2) {
								console.log('success:' + JSON.stringify(res2));
								that.payBotton = true;
								that.$eventHub.$emit('orderRefresh');
								uni.showToast({
									title: '正在跳转',
									icon: 'loading'
								});
								setTimeout(() => {
									if (that.orderType == 2) {
										uni.redirectTo({
											url: '../../../packageB/pages/groupon/otherGroupon?bargainId=' + res.data.bargainId
										});
									} else {
										uni.redirectTo({
											url: '../myOrder/myOrder'
										});
									}

									that.payBotton = false;
								}, 2500);
							},
							fail: function(err) {
								console.log('fail:' + JSON.stringify(err));

								uni.redirectTo({
									url: '../orderDetail/orderDetail?&id=' + orderId
								});
							}
						});
						//#endif
					} else {
						this.payBotton = false;
					}
				}).catch(()=>{
					this.payBotton = false;
				});
			} else {
				var goodsList = [];
				var deleteList = [];
				this.goodsData.forEach((item, index) => {
					if (item.isSample === 0) {
						if (item.suitId) {
							goodsList.push({
								suitId: item.suitId,
								suitCount: item.orderCount
							});
						} else {
							goodsList.push({
								specificationId: item.specificationId,
								productsCount: item.orderCount
							});
						}
					}
					if (item.isSample === 0) {
						deleteList.push({
							id: item.id
						});
					}
				});

				const buyerInfo = {
					areaLevel1: this.areaLevel1,
					areaLevel2: this.areaLevel2,
					areaLevel3: this.areaLevel3,
					areaLevel1code:this.areaLevel1code,
					areaLevel2code:this.areaLevel2code,
					areaLevel3code:this.areaLevel3code,
					receiveTel: this.pickupMobile,
					receiveAddress: this.addressDet,
					receiveName: this.pickupName,
					buyerComment: this.remarks
				};
				const params = {};
				params.realAmount = this.moneyFormat(this.productAmount - this.couponAmount + this.expressFeePrice);
				params.productInfo = goodsList;
				params.buyerInfo = buyerInfo;
				// #ifdef MP-WEIXIN
				params.code = this.openId;
				//#endif
				//#ifdef H5
				params.code = uni.getStorageSync('h5Openid');
				//#endif
				params.device = num;
				if(this.cpId&&this.ccId){
					params.couponUserId =`${this.ccId}|${this.cpId}`
				}else if(this.cpId){
					params.couponUserId =`${this.cpId}`
				}else if(this.ccId){
					params.couponUserId =`${this.ccId}`
				}
				params.bargainId = this.bargainId;
				if (this.orderType == 2) {
					params.orderType = 2;
				} else {
					if (this.preSaleFlag == 1) {
						params.orderType = 3;
					} else {
						params.orderType = 1;
					}
				}
				var that = this;
				console.log(params);
				this.$http.createOrder(params).then(res => {
					console.log(res);
					if (res.status == 0) {
						this.hasOrder = true;
						const orderId = this.subOrderId(res.data.orderId);
						this.orderId = this.subOrderId(res.data.orderId);
						if (this.shopcartFlag == 1) {
							this.deleteCartGoods(deleteList);
						}
						//#ifdef H5
						this.callPay(orderId, res.data);
						// #endif
						//#ifdef MP-WEIXIN || APP-PLUS
						uni.requestPayment({
							provider: 'wxpay',

							//#ifdef MP-WEIXIN
							appId: res.data.appId,
							timeStamp: res.data.timeStamp,
							nonceStr: res.data.nonceStr,
							package: res.data.package,
							signType: res.data.signType,
							paySign: res.data.paySign,
							prepayId: res.data.prepayId,
							//#endif

							// #ifndef MP-WEIXIN
							orderInfo: {
								appid: res.data.appId,
								partnerid: res.data.partnerid,
								prepayid: res.data.prepayId,
								package: res.data.package,
								sign: res.data.paySign,
								noncestr: res.data.nonceStr,
								timestamp: res.data.timeStamp,
								signType: res.data.signType
							},
							//#endif
							success: function(res2) {
								that.payBotton = true;
								that.$eventHub.$emit('orderRefresh');
								uni.showToast({
									title: '正在跳转',
									icon: 'loading'
								});
								console.log('success:' + JSON.stringify(res2));
								setTimeout(() => {
									if (that.orderType == 2 && that.bargainId == null) {
										uni.redirectTo({
											url: '../../../packageB/pages/groupon/otherGroupon?bargainId=' + res.data.bargainId
										});
									} else {
										uni.redirectTo({
											url: '../myOrder/myOrder'
										});
									}
									that.payBotton = false;
								}, 2500);
							},
							fail: function(err) {
								console.log('fail:' + JSON.stringify(err));
								uni.redirectTo({
									url: '../orderDetail/orderDetail?&id=' + orderId
								});
							}
						});
						//#endif
					}
					else{
						this.payBotton = false;
					}
				});
			}
		},
		deleteCartGoods(id) {
			let params = {
				ids: id
			};
			var that = this
			this.$http.editShopcart(params).then(res => {
				if (res.status == 0) {
					that.$eventHub.$emit('shopcartRefresh');
				}
			});
		},
		addAddress() {
			uni.navigateTo({
				url: '../editAddress/editAddress?submitOrderFlag=1'
			});
		},
		editAddress() {
			uni.navigateTo({
				url: '../myAddress/myAddress?submitOrderFlag=1'
			});
		},
		getUserAddress() {
			this.isLoading1 = true;
			let params={
				type:2,
			}
			this.$http.customersIncipient(params).then(res => {
				if (res.status == 0) {
					const addressList = res.data.customersAddressData;
					if (addressList == 0) {
						this.addressFlag = false;
					} else {
						let num = 0;
						for (let i = 0; i < addressList.length; i += 1) {
							if (addressList[i].customerAddressId == this.customerAddressId) {
								this.addressFlag = true;
								num += 1;
								this.pickupName = addressList[i].pickupName;
								this.pickupMobile = addressList[i].pickupMobile;
								this.addressDet = addressList[i].addressDet;
								this.customerAddressId = addressList[i].customerAddressId;
								this.areaLevel1 = addressList[i].province;
								this.areaLevel2 = addressList[i].city;
								this.areaLevel3 = addressList[i].district;
								this.areaLevel1code = addressList[i].areaLevel1code;
								this.areaLevel2code = addressList[i].areaLevel2code;
								this.areaLevel3code = addressList[i].areaLevel3code;
							}
						}
						if (num == 0) {
							this.addressFlag = true;
							for (let i = 0; i < addressList.length; i += 1) {
								if (addressList[i].isDefault == 1) {
									this.pickupName = addressList[i].pickupName;
									this.pickupMobile = addressList[i].pickupMobile;
									this.addressDet = addressList[i].addressDet;
									this.customerAddressId = addressList[i].customerAddressId;
									this.areaLevel1 = addressList[i].province;
									this.areaLevel2 = addressList[i].city;
									this.areaLevel3 = addressList[i].district;
									this.areaLevel1code = addressList[i].areaLevel1code;
									this.areaLevel2code = addressList[i].areaLevel2code;
									this.areaLevel3code = addressList[i].areaLevel3code;
								}
							}
						}
					}
				}
				this.isLoading1 = false;
			});
		}
	}
};
</script>

<style lang="scss">
.tui-safe-area {
	height: 1rpx;
	padding-bottom: calc(env(safe-area-inset-bottom) + 200rpx);
}
.refundInfo {
	display: flex;
	justify-content: space-between;
	background-color: #fff;

	.img {
		width: 80rpx;
		height: 80rpx;
	}
	.setupTitle {
		position: relative;
	}
	.stars {
		color: #f54f46;
		position: absolute;
		top: -10rpx;
		left: 64rpx;
	}
}
.preSaleTag {
	background-color: #e96d71;
	width: 50rpx;
	height: 20rpx;
	color: #ffffff;
	padding: 0rpx 10rpx;
	margin-right: 5px;
	border-radius: 10rpx;
}
.redRow {
	color: #e96d71 !important;
}

.imgMark {
	position: absolute;
	width: 100rpx !important;
	height: 100rpx !important;
	top: 0px;
	left: 12rpx;
	z-index: 99;
}
.addAddress {
	margin: 0 auto;
	font-size: 24rpx;
	color: #333;
	padding: 6rpx 20rpx;
	border-radius: 40rpx;
	color: #fff;
}
.pickupMobile {
	color: #aaa;
	padding-left: 15rpx;
	font-weight: normal;
}
.container {
	padding-bottom: 98rpx;
}
.radioW {
	width: 80rpx;
	display: flex;
	justify-content: center;
	align-items: center;
}
.sticky-me .mescroll-body {
	min-height: 600rpx !important;
}
.radioBox {
	width: 30rpx;
	height: 30rpx;
	border: 1px solid #8f8d8e;
	border-radius: 50%;
	display: flex;
	justify-content: center;
	align-items: center;

	.iconfont {
		color: #ffffff;
		font-size: 28rpx;
		margin-top: 2rpx;
	}
}
.couponMoney {
	color: #e04b28;
}
.tui-box {
	padding: 20rpx 0 20rpx;
	box-sizing: border-box;
}
.tui-goods-title {
	width: 100%;
	font-size: 28rpx;
	line-height: 28rpx;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.tui-flex-box {
	width: 100%;
	display: flex;
	align-items: center;
	padding: 20rpx 0;
	position: relative;
	.address-tag {
		position: absolute;
		right: 20rpx;
		top: 16rpx;
		font-size: 24rpx;
		color: #333;
		padding: 6rpx 20rpx;
		border-radius: 40rpx;
		color: #fff;
	}
}

.tui-icon-img {
	width: 44rpx;
	height: 44rpx;
	flex-shrink: 0;
}

.tui-addr {
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding-left: 20rpx;
	box-sizing: border-box;
}

.tui-addr-userinfo {
	font-size: 30rpx;
	line-height: 30rpx;
	font-weight: bold;
}

.tui-addr-text {
	font-size: 24rpx;
	line-height: 30rpx;
	padding-top: 16rpx;
}

.tui-bg-img {
	position: absolute;
	width: 100%;
	height: 8rpx;
	left: 0;
	bottom: 0;
	background: url('')
		repeat;
}

.tui-top {
	margin-top: 20rpx;
	overflow: hidden;
}
.tui-padding {
	box-sizing: border-box;
}

.tui-goods-item {
	width: 100%;
	padding: 20rpx 30rpx;
	box-sizing: border-box;
	display: flex;
	justify-content: space-between;
}

.tui-goods-img {
	width: 180rpx;
	height: 180rpx;
	display: block;
	flex-shrink: 0;
	border-radius: 8rpx;
}

.tui-goods-center {
	flex: 1;
	padding: 20rpx 8rpx;
	box-sizing: border-box;
}

.tui-goods-name {
	max-width: 310rpx;
	word-break: break-all;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	font-size: 26rpx;
	line-height: 32rpx;
}

.tui-goods-attr {
	font-size: 22rpx;
	color: #888888;
	line-height: 32rpx;
	padding-top: 20rpx;
	word-break: break-all;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.tui-price-right {
	text-align: right;
	font-size: 24rpx;
	color: #888888;
	line-height: 30rpx;
	padding-top: 20rpx;
}

.tui-flex {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: 26rpx;
}
.tui-total-flex {
	justify-content: flex-end;
}

.tui-color-red,
.tui-invoice-text {
	color: #e41f19;
	padding-right: 30rpx;
}

.tui-balance {
	font-size: 28rpx;
	font-weight: 500;
}

.tui-black {
	color: #222;
	line-height: 30rpx;
}

.tui-gray {
	color: #888888;
	font-weight: 400;
}

.tui-light-dark {
	color: #666;
}

.tui-goods-price {
	display: flex;
	align-items: center;
	padding-top: 20rpx;
}

.tui-size-26 {
	font-size: 26rpx;
	line-height: 26rpx;
}

.tui-price-large {
	font-size: 34rpx;
	line-height: 32rpx;
	// font-weight: 600;
}

.tui-flex-end {
	display: flex;
	align-items: flex-end;
	padding-right: 0;
}

.tui-phcolor {
	color: #b3b3b3;
	font-size: 26rpx;
}
.couponTip {
	color: #b3b3b3;
	font-size: 26rpx;
	padding-left: 91rpx;
}
.redTip {
	color: #b3b3b3;
	font-size: 26rpx;
	padding-left: 117rpx;
}
.tui-phcolor .iconfont {
	margin-left: 10rpx;
}

/* #ifndef H5 */
.tui-remark-box {
	padding: 22rpx 30rpx;
}

/* #endif */
/* #ifdef H5 */
.tui-remark-box {
	padding: 26rpx 30rpx;
}

/* #endif */

.tui-remark {
	flex: 1;
	font-size: 26rpx;
	padding-left: 64rpx;
}

.tui-scale-small {
	transform: scale(0.8);
	transform-origin: 100% center;
}

.tui-scale-small .wx-switch-input {
	margin: 0 !important;
}

/* #ifdef H5 */
>>> uni-switch .uni-switch-input {
	margin-right: 0 !important;
}

/* #endif */
.tui-pr-30 {
	padding-right: 30rpx;
}

.tui-pr-20 {
	padding-right: 20rpx;
}

.tui-none-addr {
	height: 80rpx;
	padding-left: 5rpx;
	display: flex;
	align-items: center;
}

.tui-addr-img {
	width: 36rpx;
	height: 46rpx;
	display: block;
	margin-right: 15rpx;
}

// .tui-pr25 {
// 	padding-right: 25rpx;
// }

.submit-order-tabbar {
	justify-content: space-between;
	box-sizing: border-box;
	padding-left: 30rpx;
}
/* 提示窗口 */
.uni-tip {
	padding: 15px;
	width: 290px;
	background: #fff;
	box-sizing: border-box;
	border-radius: 10px;
}

.uni-tip-title {
	text-align: center;
	font-weight: bold;
	font-size: 16px;
	color: #333;
}

.uni-tip-content {
	padding: 15px;
	font-size: 14px;
	color: #666;
}

.uni-tip-group-button {
	margin-top: 10px;
	display: flex;
	justify-content: space-between;
}

.uni-tip-button {
	width: 45%;
	text-align: center;
	font-size: 14px;
	border-radius: 50rpx;
	color: #3b4144;
	background-color: #ffffff;
}
.uni-tip-group-button .no {
	border: 1rpx solid $borderColor;
}
.uni-tip-group-button .ok {
	background-color: #0bb20c;
	color: #ffffff;
}
.uni-tip-box {
	padding: 15rpx;
	width: 100%;
	background: #fff;
	box-sizing: border-box;

	border-radius: 20px 20rpx 0 0;
}
.tipContent {
	height: 600rpx;
	overflow-y: auto;
}
.tabs-item-wrap {
	display: inline-block;
	white-space: nowrap;
	height: 90rpx;
	width: 50%;

	.tabs-item {
		margin-left: 35rpx;
		margin-right: 30rpx;
		position: relative;
		height: 100%;
		display: flex;
		align-items: center;
		justify-content: center;

		.tabs-item-txt {
			height: 90rpx;
			line-height: 90rpx;
			font-size: 30rpx;
			font-weight: 400;
			// color: #333333;
		}

		.tabs-item-bottom {
			position: absolute;
			bottom: 8rpx;
			width: 100%;
			// height: 2rpx;
		}
	}
}
.redContainer {
	width: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	z-index: 9999;
	margin-top: 20rpx;
	.moneyBox {
		background: #ffffff;
		// margin-top: -500rpx;
		height: 170rpx;
		width: 90%;
		border-radius: 20rpx;
		border: 1px solid #b2b2b2;
		display: flex;

		.moneyLeft {
			width: 200rpx;
			// border-right: 1px dashed #666666;
			text-align: center;
			padding-top: 50rpx;
			border-radius: 17rpx 0 0 17rpx;

			.moneyLeftWord {
				color: #ffffff;
				font-size: 36rpx;
			}
			.moneyLeft-small {
				color: #ffffff;
				font-size: 26rpx;
			}
		}
		.moneyRight {
			flex: 1;
			padding: 20rpx;

			.moneyName {
				color: #525252;
				font-size: 30rpx;
			}
			.moneyType {
				color: #666666;
				font-size: 28rpx;
				padding: 10rpx 0;
			}
			.moneyDate {
				color: #b2b2b2;
				font-size: 26rpx;
			}
		}
	}

	.couponBox {
		background: #ffffff;
		// margin-top: -500rpx;
		height: 170rpx;
		width: 90%;
		// border-radius: 20rpx;
		border-top: 1px solid #b2b2b2;
		border-bottom: 1px solid #b2b2b2;
		border-right: 1px solid #b2b2b2;
		display: flex;
		// background-image: radial-gradient(circle at 621rpx 7px, transparent 6px, #B2B2B2 6px, #fff 8px);
		// background-position: 0 0, 621rpx 0;
		// background-repeat-x: no-repeat;
		// background-size: 621rpx 23px;

		.couponLeft {
			width: 200rpx;
			// border-right: 1px dashed #666666;
			text-align: center;
			padding-top: 50rpx;
			// border-radius: 17rpx 0 0 17rpx;

			.couponLeftWord {
				color: #ffffff;
				font-size: 36rpx;
			}
			.couponLeft-small {
				color: #ffffff;
				font-size: 26rpx;
			}
		}
		.couponRight {
			flex: 1;
			padding: 20rpx;

			.couponName {
				color: #525252;
				font-size: 30rpx;
				width: 300rpx;
				overflow: hidden;
				text-overflow: ellipsis;
				white-space: nowrap;
			}
			.couponType {
				color: #666666;
				font-size: 28rpx;
				padding: 10rpx 0;
			}
			.couponDate {
				color: #b2b2b2;
				font-size: 24rpx;
			}
		}
	}
}
.radiobox {
	display: flex;
	flex-direction: column;
	align-items: center;
}
.radiobox label {
	display: flex;
	align-items: center;
}
.uni-tip-group-button .no {
	border: 1rpx solid $borderColor;
}
.uni-tip-group-button .ok {
	background-color: #0bb20c;
	color: #ffffff;
}
.pin {
	display: flex;
	justify-content: center;
	align-items: center;
	font-size: 28rpx;
	width: 85rpx;
}
.noCoupon {
	display: flex;
	justify-content: space-between;
	color: #525252;
	width: 91%;
	margin-top: 40rpx;
}
</style>
